package com.itheima;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisPoolLinux {
    public static void main(String[] args) {
        JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
        jedisPoolConfig.setMaxTotal(30);//最大连接数
        jedisPoolConfig.setMaxIdle(10);//最大空闲数
        jedisPoolConfig.setEvictorShutdownTimeoutMillis(3000);//最大等待时间
        JedisPool jedisPool = new JedisPool("192.168.85.165", 6379);
        Jedis jedis = jedisPool.getResource();
        String phone = jedis.get("phone");
        System.out.println(phone);
        jedis.close();
    }
}
